#!/usr/bin/env python
# -*- coding: latin-1 -*-
# -*- coding: cp1252 -*-


def summa(tala):
	summa = 0
	for x in range(1, tala):
		if x%2 == 1 or x%6==0:
			summa += x
	return summa

tala= int(input())
print (summa(tala))
